package org.bioversityinternational.mgbms.model.domain;

// Generated 13 oct. 2011 12:11:05 by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Shipment generated by hbm2java
 */
@Entity
@Table(name = "Shipment", schema = "dbo", catalog = "imgbms")
public class Shipment implements java.io.Serializable {

	private Integer id;
	private Country country;
	private String shipmentnumber;
	private Date shipmentdate;
	private String pcnumber;
	private Date pcdate;
	private String pipnumber;
	private Date pipdate;
	private String ppnumber;
	private Date ppdate;
	private String shipmentobservation;
	private String address1;
	private String address2;
	private String zipCode;
	private String city;
	private String localityId;
	private String province;
	private Set<AssShipmentAccession> assShipmentAccessions = new HashSet<AssShipmentAccession>(
			0);
	private Set<Order> orders = new HashSet<Order>(0);

	public Shipment() {
	}

	public Shipment(Country country, String shipmentnumber, Date shipmentdate,
			String pcnumber, Date pcdate, String pipnumber, Date pipdate,
			String ppnumber, Date ppdate, String shipmentobservation,
			String address1, String address2, String zipCode, String city,
			String localityId, String province,
			Set<AssShipmentAccession> assShipmentAccessions, Set<Order> orders) {
		this.country = country;
		this.shipmentnumber = shipmentnumber;
		this.shipmentdate = shipmentdate;
		this.pcnumber = pcnumber;
		this.pcdate = pcdate;
		this.pipnumber = pipnumber;
		this.pipdate = pipdate;
		this.ppnumber = ppnumber;
		this.ppdate = ppdate;
		this.shipmentobservation = shipmentobservation;
		this.address1 = address1;
		this.address2 = address2;
		this.zipCode = zipCode;
		this.city = city;
		this.localityId = localityId;
		this.province = province;
		this.assShipmentAccessions = assShipmentAccessions;
		this.orders = orders;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "countryId")
	public Country getCountry() {
		return this.country;
	}

	public void setCountry(Country country) {
		this.country = country;
	}

	@Column(name = "shipmentnumber", length = 50)
	public String getShipmentnumber() {
		return this.shipmentnumber;
	}

	public void setShipmentnumber(String shipmentnumber) {
		this.shipmentnumber = shipmentnumber;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "shipmentdate", length = 23)
	public Date getShipmentdate() {
		return this.shipmentdate;
	}

	public void setShipmentdate(Date shipmentdate) {
		this.shipmentdate = shipmentdate;
	}

	@Column(name = "pcnumber", length = 50)
	public String getPcnumber() {
		return this.pcnumber;
	}

	public void setPcnumber(String pcnumber) {
		this.pcnumber = pcnumber;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "pcdate", length = 23)
	public Date getPcdate() {
		return this.pcdate;
	}

	public void setPcdate(Date pcdate) {
		this.pcdate = pcdate;
	}

	@Column(name = "pipnumber", length = 50)
	public String getPipnumber() {
		return this.pipnumber;
	}

	public void setPipnumber(String pipnumber) {
		this.pipnumber = pipnumber;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "pipdate", length = 23)
	public Date getPipdate() {
		return this.pipdate;
	}

	public void setPipdate(Date pipdate) {
		this.pipdate = pipdate;
	}

	@Column(name = "ppnumber", length = 50)
	public String getPpnumber() {
		return this.ppnumber;
	}

	public void setPpnumber(String ppnumber) {
		this.ppnumber = ppnumber;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "ppdate", length = 23)
	public Date getPpdate() {
		return this.ppdate;
	}

	public void setPpdate(Date ppdate) {
		this.ppdate = ppdate;
	}

	@Column(name = "shipmentobservation", length = 50)
	public String getShipmentobservation() {
		return this.shipmentobservation;
	}

	public void setShipmentobservation(String shipmentobservation) {
		this.shipmentobservation = shipmentobservation;
	}

	@Column(name = "address1", length = 50)
	public String getAddress1() {
		return this.address1;
	}

	public void setAddress1(String address1) {
		this.address1 = address1;
	}

	@Column(name = "address2", length = 50)
	public String getAddress2() {
		return this.address2;
	}

	public void setAddress2(String address2) {
		this.address2 = address2;
	}

	@Column(name = "zipCode", length = 50)
	public String getZipCode() {
		return this.zipCode;
	}

	public void setZipCode(String zipCode) {
		this.zipCode = zipCode;
	}

	@Column(name = "city", length = 50)
	public String getCity() {
		return this.city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	@Column(name = "localityId", length = 50)
	public String getLocalityId() {
		return this.localityId;
	}

	public void setLocalityId(String localityId) {
		this.localityId = localityId;
	}

	@Column(name = "province", length = 50)
	public String getProvince() {
		return this.province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "shipment")
	public Set<AssShipmentAccession> getAssShipmentAccessions() {
		return this.assShipmentAccessions;
	}

	public void setAssShipmentAccessions(
			Set<AssShipmentAccession> assShipmentAccessions) {
		this.assShipmentAccessions = assShipmentAccessions;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "AssOrderShipment", schema = "dbo", catalog = "imgbms", joinColumns = { @JoinColumn(name = "shipmentId", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "orderId", nullable = false, updatable = false) })
	public Set<Order> getOrders() {
		return this.orders;
	}

	public void setOrders(Set<Order> orders) {
		this.orders = orders;
	}

}
